import store from "@/store";
import dayjs from "dayjs";
console.log(88);
export const formItemStyle = {
  paddingLeft: "20px",
};

export const cellStyle = {
  background: "rgba(28, 155, 252, 0.02)",
  color: "rgb(142, 155, 185)",
  textAlign: "center",
};

// 表头单元格样式
export const headerCellStyle = {
  background: "rgba(28, 155, 252, 0.02)",
  color: "rgb(142, 155, 185)",
  textAlign: "center",
};

// 表格内表单子样式
export const tableFormStyle = {
  marginBottom: 0,
};
export const formBase = [
  {
    label: "日期",
    type: "daterange",
    field: "shelfTime",
    prop: "shelfTime",
    required: true,
    otherOptions: {
      disabled: false,
      rangeSeparator: "至",
      startPlaceholder: "开始日期",
      endPlaceholder: "结束日期",
      pickerOptions: {
        shortcuts: [
          {
            text: "今天",
            onClick(picker) {
              const end = dayjs().format("YYYY-MM-DD 23:59:59");
              const start = dayjs().format("YYYY-MM-DD 00:00:00");
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "昨天",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              end.setTime(start.getTime() - 3600 * 1000 * 24);
              start.setTime(start.getTime() - 3600 * 1000 * 24);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近三天",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 3);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一周",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一个月",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit("pick", [start, end]);
            },
          },
        ],
      },
    },
  },
  {
    label: "仓库",
    type: "select",
    field: "storage",
    optionsKey: "warehouseName",
    optionsValue: "id",
    options: store.state.custom_dict.warehouse,
  },
  {
    label: "目的地",
    type: "select",
    required: true,
    field: "destination",
    prop: "scanName",
    optionsKey: "destinationName",
    optionsValue: "destinationId",
    options: [],
  },
];

export const tableBase = [
  {
    label: "复核时间",
    prop: "recheckTime",
    width: "200",
    operate: {
      type: "input",
      field: "recheckTime",
    },
  },
  {
    label: "转运单号",
    prop: "transitOrderNo",
    width: 150,
    operate: {
      type: "input",
      field: "transitOrderNo",
    },
  },
  {
    label: "件数",
    prop: "pieces",
    width: 150,
    operate: {
      type: "input",
      field: "pieces",
    },
  },
  {
    label: "实际重",
    prop: "weight",
    width: 150,
    operate: {
      type: "input",
      field: "weight",
    },
  },
  {
    label: "核算重",
    prop: "recheckWeight",
    width: 150,
    operate: {
      type: "input",
      field: "recheckWeight",
    },
  },
  {
    label: "扫描仓",
    prop: "scanStore",
    width: 200,
    operate: {
      type: "input",
      field: "scanStore",
    },
  },
  {
    label: "复核员",
    prop: "recheckName",
    width: 200,
    operate: {
      type: "input",
      field: "recheckName",
    },
  },
  {
    label: "长",
    prop: "longs",
    width: 200,
    operate: {
      type: "input",
      field: "longs",
    },
  },
  {
    label: "宽",
    prop: "widths",
    width: 200,
    operate: {
      type: "input",
      field: "widths",
    },
  },
  {
    label: "高",
    prop: "heights",
    width: 150,
    operate: {
      type: "input",
      field: "heights",
    },
  },
  {
    label: "立方数",
    prop: "cubicCount",
    width: 150,
    operate: {
      type: "input",
      field: "cubicCount",
    },
  },
  {
    label: "体积重",
    prop: "volumeWeight",
    width: 150,
    operate: {
      type: "input",
      field: "volumeWeight",
    },
  },
];
